<h1>Laporan Bulan Ini <input type="button" id="btn-cetak" class="btn btn-primary" value="Cetak"></h1>
<?php
echo "<table class='table table-bordered table-striped'>";
    $last_day = date("t");
        echo "<tr><th>Tanggal</th>";
        foreach($loket as $lokets){
            echo "<th>$lokets->loket_kode</th>";
        }
        echo "<th>Total</th>";
        echo "</tr>";
    for($i=1; $i<= $last_day; $i++){
        echo "<tr><td>$i ".date("M Y")."</td>";
        foreach($loket as $lokets){
        echo "<td>".((@$data[$i]["loket"][$lokets->loket_id] == "")?0:@$data[$i]["loket"][$lokets->loket_id] )."</td>";
        }
        echo "<td>".((@$data[$i]["jml"] == "" )?0:@$data[$i]["jml"])."</td>";
        echo "</tr>";
    }
echo "</table>";
?>
<script>
    $(function(){
        btncetak = $("#btn-cetak");
        
        btncetak.click(function(){
            window.open("<?php echo base_url("../print/report.html"); ?>","","width=800;height=400");
        });
    });
</script>